import Vue from 'vue'
/**权限指令**/
Vue.directive('has', {
    inserted: function(el, binding) {
        debugger
        if (!Vue.prototype.$_has(binding.value)) {
            if (el.parentNode != null) {
                setTimeout(() => console.log(el.parentNode))
                el.parentNode.removeChild(el);
            }
        }
    },
});
//权限检查方法
Vue.prototype.$_has = function(value) {
    console.log(value);
    let isExist = false;
    let buttonpermsStr = ['Add', 'Update'];
    if (buttonpermsStr == undefined || buttonpermsStr == null) {
        return false;
    }
    for (let i = 0; i < buttonpermsStr.length; i++) {
        if (value == buttonpermsStr[i]) {
            isExist = true;
            break;
        }
    }
    return isExist;
};